#include "fxcc/imgui/Editor.h"
#include "fxcc/core/graph/common/TextLine.h"

using namespace fxcc::graph::common;
using namespace fxcc::imgui;


template <>
bool Editor::Edit(const std::string& label, fxcc::graph::common::TextLine& inst)
{
    EditInst<std::string>("text", inst.m_Text);
    EditInst<int>("font size", inst.m_FontSize);
    EditInst<glm::vec2>("Pos ", inst.m_Pos);
    CheckBoxInst<bool>("m_UseLimit", inst.m_UseLimit);
    EditInst<glm::vec2>("m_LimitSize", inst.m_LimitSize);
    EditInst<std::string>("m_FontFamily", inst.m_FontFamily);
    //auto& factory = fxcc::graph::opengl3::font::Factory::Inst();

    //if (ImGui::BeginCombo("font Family", inst.m_FontFamily.c_str()))
    //{
    //    for (auto it : factory.m_FontLibs)
    //    {
    //        auto fontIt = it.second;

    //        std::string itLabel = it.first.c_str();
    //        itLabel += " ";
    //        itLabel += it.second->m_Family;

    //        if (ImGui::Selectable(itLabel.c_str(), fontIt->m_Family == inst.m_FontFamily))
    //        {
    //            inst.m_FontFamily = it.first;
    //        }
    //    }
    //    ImGui::EndCombo();
    //}

    ColorInst("Color", inst.m_TextColor);
    return false;
}
